package cn.cool.controller;


import cn.cool.entity.Comment;
import cn.cool.service.CommentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author LiuH
 * @since 2021-01-23
 */
@RestController
@RequestMapping("/comment")
@Api(tags = "评论接口")
public class CommentController {

    @Autowired
    private CommentService commentService;

    @PostMapping("/sendComment")
    @ApiOperation(value = "发送评论")
    public Object sendComment(HttpServletRequest request, Comment comment){
        Object result = commentService.addComment(request, comment);
        return result;
    }

}

